package p270jp.pxv.android.viewholder;

import android.text.TextUtils;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import p216hn.DefaultConstructorMarker;
import p270jp.pxv.android.R;
import p270jp.pxv.android.view.DetailProfileWorksView;
import p270jp.pxv.android.view.LiveTitleBarView;
import p314lg.ViewHolderLiveInfoItemBinding;
import p325m0.MutabilityOwnership;
import p371nj.LiveInfoState;
import p652yj.C7346b;

/* compiled from: LiveInfoViewHolder.kt */
/* renamed from: jp.pxv.android.viewholder.LiveInfoViewHolder */
/* loaded from: classes2.dex */
public final class LiveInfoViewHolder extends RecyclerView.AbstractC0819y {
    private final ViewHolderLiveInfoItemBinding binding;
    private LiveInfoState prevState;
    public static final Companion Companion = new Companion(null);
    public static final int $stable = 8;

    /* compiled from: LiveInfoViewHolder.kt */
    /* renamed from: jp.pxv.android.viewholder.LiveInfoViewHolder$Companion */
    /* loaded from: classes2.dex */
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(DefaultConstructorMarker eVar) {
            this();
        }

        public final LiveInfoViewHolder createViewHolder(ViewGroup viewGroup) {
            ViewHolderLiveInfoItemBinding i7Var = (ViewHolderLiveInfoItemBinding) C7346b.m327a(viewGroup, "parent", R.layout.view_holder_live_info_item, viewGroup, false);
            LiveTitleBarView liveTitleBarView = i7Var.f21689s;
            liveTitleBarView.f19555a.f22460s.setTextSize(0, liveTitleBarView.getResources().getDimension(R.dimen.live_info_counter_bar_title_size));
            i7Var.f21689s.f19555a.f22459r.setVisibility(8);
            return new LiveInfoViewHolder(i7Var, null);
        }
    }

    private LiveInfoViewHolder(ViewHolderLiveInfoItemBinding i7Var) {
        super(i7Var.f2666e);
        this.binding = i7Var;
    }

    public /* synthetic */ LiveInfoViewHolder(ViewHolderLiveInfoItemBinding i7Var, DefaultConstructorMarker eVar) {
        this(i7Var);
    }

    public final void onBindViewHolder(LiveInfoState pVar) {
        LiveInfoState.C5373b bVar;
        LiveInfoState.C5373b bVar2;
        MutabilityOwnership.m3745m(pVar, "state");
        this.binding.f21689s.setTitle(pVar.f23931c);
        this.binding.f21689s.setAudienceCount(pVar.f23934f);
        this.binding.f21689s.setTotalAudienceCount(pVar.f23935g);
        this.binding.f21689s.setChatCount(pVar.f23937i);
        this.binding.f21689s.setHeartCount(pVar.f23936h);
        this.binding.f21689s.setElapsedDuration(pVar.f23938j);
        if (TextUtils.isEmpty(pVar.f23932d)) {
            this.binding.f21687q.setVisibility(8);
        } else {
            this.binding.f21687q.setVisibility(0);
            this.binding.f21687q.setText(pVar.f23932d);
        }
        if (pVar.f23944p == 1) {
            LiveInfoState.C5373b bVar3 = pVar.f23943o;
            LiveInfoState pVar2 = this.prevState;
            if (pVar2 == null) {
                bVar = null;
            } else {
                bVar = pVar2.f23943o;
            }
            if (!MutabilityOwnership.m3749h(bVar3, bVar) && (bVar2 = pVar.f23943o) != null) {
                this.binding.f21688r.m4499b(bVar2.f23947a, bVar2.f23948b);
                if (bVar2.f23948b.isEmpty()) {
                    DetailProfileWorksView detailProfileWorksView = this.binding.f21688r;
                    detailProfileWorksView.f19496a.f21864u.setVisibility(8);
                    detailProfileWorksView.f19496a.f21866w.setVisibility(8);
                    detailProfileWorksView.f19498c.f3606a.m10780b();
                }
            }
            if (pVar.f23941m) {
                this.binding.f21688r.f19496a.f21861r.setVisibility(0);
                this.binding.f21690t.setVisibility(0);
            } else {
                this.binding.f21688r.f19496a.f21861r.setVisibility(8);
                this.binding.f21690t.setVisibility(8);
            }
            this.prevState = pVar;
        }
    }
}
